home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
redakcyjne
/
programy
/
Gadu-Gadu 8.0 Build 9103
/
nowegg.exe
/
scripts
/
smslimit.js
< prev
Wrap
Text File
|
2009-07-08
|
2KB
|
83 lines
var net_unknown = ".js";
var net_plus = "sms_pl_plus.js";
var net_orange = "sms_pl_orange.js";
var net_era = "sms_pl_era.js";
var net_gadugadu = "sms_pl_gaduair.js";
var plus_limit = "273";
var orange_limit = "622";
var era_limit = "109";
var gadugadu_limit = "256";
var unknown_limit = "999";
var hostName = "sms.orange.pl";
var urlName = "/dev_getads.aspx?applid=57820826-EB86-4d55-ADD5-3955D85E0D8A";
var msg_usernotonline = "Musisz byµ zalogowany aby wys│aµ SMS";
function findTokenIdOnPage(page)
{
var reg = /token value=\"([^\"]*)\"/;
var ret = page.match(reg);
if ( !ret )
return "";
return ret[1];
};
function findMaxLengthOnPage(page)
{
var reg = /maxlen value=\"([^\"]*)\"/;
var ret = page.match(reg);
if(!ret)
{
return "";
}
return ret[1];
};
function main()
{
if (network == net_plus)
{
return [plus_limit];
}
if (network == net_orange)
{
if(!helper.IsUserOnline())
{
return [msg_usernotonline];
}
var smsPage = helper.get(hostName, urlName);
var tokenId = findTokenIdOnPage(smsPage);
var maxLength = findMaxLengthOnPage(smsPage);
helper.SetTokenValue(tokenId);
helper.SetMaxLengthValue(maxLength);
return [maxLength];
}
if (network == net_era)
{
return [era_limit];
}
if (network == net_gadugadu)
{
return [gadugadu_limit];
}
return [unknown_limit];
function ExtractArray(page)
{
var ext = page.substr(5);
return [ext];
}
}
main();